[pull] trunk from cli:trunk#86
Merged
Merged
Conversation
- Introduced `--ref` flag to narrow down cache deletion to a specific branch or PR reference. - Updated command examples to include usage of `--ref`. - Added validation to ensure `--ref` cannot be used with `--all` and must accompany a cache key/ID.
* Implemented test cases for handling the `--ref` flag in cache deletion commands. * Added validation for using `--ref` with cache key and ID. * Ensured proper error messages are returned for invalid usage of `--ref`.
* Clarified the description of the `--ref` flag to specify its purpose more accurately. * Ensures users understand that it narrows down deletion by cache key and ref.
* Changed the error message from "--ref cannot be used without cache key/ID" to "must provide a cache key" for clarity. * Updated corresponding test case to reflect the new error message.
* Replaced direct conversion of cache ID string to int with a dedicated `parseCacheID` function. * Improved readability and maintainability of the `deleteCaches` function.
* Added validation to ensure that the `--ref` flag cannot be used when a cache ID is provided. * Updated error message to include the reference when a cache is not found with the specified `--ref`.
* Ensure that the `--ref` flag cannot be used in conjunction with a cache ID. * Update error handling to provide clear feedback when this condition is violated. * Add tests to cover scenarios involving the `--ref` flag and cache ID.
Signed-off-by: Babak K. Shandiz <babakks@github.com>
Signed-off-by: Babak K. Shandiz <babakks@github.com>
Signed-off-by: Babak K. Shandiz <babakks@github.com>
Signed-off-by: Babak K. Shandiz <babakks@github.com>
Signed-off-by: Babak K. Shandiz <babakks@github.com>
Also note that the API never returns HTTP 422 for invalid refs. Signed-off-by: Babak K. Shandiz <babakks@github.com>
This bumps sigstore/rekor to v1.4.1 to get a vulnerability fix in the downstream go-chi/chi
feat: add support for `--ref` in `gh cache delete`
Bump sigstore/rekor to v1.4.1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.3)
Can you help keep this open source service alive? 💖 Please sponsor : )